Zero Code Instrumentation: Zero Code Instrumentation
Description
otel supports zero-code instrumentation (ZCI) via the
OTEL_INSTRUMENT_R_PKGS environment variable. Set this to a comma
separated list of package names, the packages that you want to
instrument. Then otel will hook up base::trace() to produce
OpenTelemetry output from every function of these packages.
Arguments
Value
Not applicable.
Details
By default all functions of the listed packages are instrumented. To
instrument a subset of all functions set the
OTEL_INSTRUMENT_R_PKGS_<PKG>_INCLUDE environment variable to a list of
glob expressions. <PKG> is the package name in all capital letters.
Only functions that match to at least one glob expression will be
instrumented.
To exclude functions from instrumentation, set the
OTEL_INSTRUMENT_R_PKGS_<PKG>_EXCLUDE environment variable to a list of
glob expressions. <PKG> is the package name in all capital letters.
Functions that match to at least one glob expression will not be
instrumented. Inclusion globs are applied before exclusion globs.
Caveats
If the user calls base::trace() on an instrumented function, that
deletes the instrumentation, since the second base::trace() call
overwrites the first.